<?php namespace App\Repositories\User;

use App\Repositories\Eloquent\User\Entity\SocialiteUser;

interface UserRepositoryInterface
{
    /**
     * Find user or users by user id.
     *
     * @param $id
     *
     * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Model[]|null
     */
    public function show($id);

    /**
     * Find user or users by uid.
     *
     * @param $id
     *
     * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Model[]|null
     */
    public function showByUid($uid);

    /**
     * 新建用户
     *
     * @param SocialiteUser $user
     *
     * @return \Illuminate\Database\Eloquent\Model
     */
    public function store(SocialiteUser $user);

    /**
     * 修改用户信息
     *
     * @param               $user_id
     * @param SocialiteUser $user
     */
    public function update($user_id, SocialiteUser $user);

    /**
     * 增加邀请记录
     *
     * @param $user_id
     * @param $invite_uid
     *
     * @return bool
     */
    public function storeUserInvite($user_id, $invite_uid);

    /**
     * 用户邀请人uid
     *
     * @param $user_id
     *
     * @return int|null
     */
    public function getUserInviteUid($user_id);

}
